package cn.edu.nhic.nhcarsb.service.impl;

import cn.edu.nhic.nhcarsb.entity.Users;
import cn.edu.nhic.nhcarsb.dao.UsersDao;
import cn.edu.nhic.nhcarsb.service.UsersService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author nh_HWB
 * @since 2024-10-27
 */
@Service
public class UsersServiceImpl extends ServiceImpl<UsersDao, Users> implements UsersService {

    @Override
    public boolean checkUname(String uname) {
        LambdaQueryWrapper<Users> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(Users::getUname, uname);
        return count(lambdaQueryWrapper) > 0;
    }
}
